package com.wyh.apitest.source

import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment}

//定义样例类
//case class SensorReading(id: String, timestamp: Long, temperature: Double)

object SourceFile {
  def main(args: Array[String]): Unit = {

    val streamEnv = StreamExecutionEnvironment.getExecutionEnvironment

    //从文件中读取数据
    val inputPath: String = "D:\\IdeaProjects\\FlinkStudyScala\\src\\main\\resources\\sensor.txt"
    val stream3: DataStream[String] = streamEnv.readTextFile(inputPath)
    stream3.print()

    streamEnv.execute("Source File")
  }

}